package com.zhentao.controller;


import com.zhentao.dto.Dto;
import com.zhentao.pojo.Emp;
import com.zhentao.pojo.EmpSer;
import com.zhentao.service.impl.EmpServiceImpl;
import com.zhentao.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("emp")
public class EmpController {
    @Autowired
    private EmpServiceImpl empService;
    @RequestMapping("addEmp")
    public String addEmp(@RequestBody Emp emp){
        return empService.addEmp(emp);
    }
    @RequestMapping("updStatus")
    public String updStatus(@RequestBody Dto dto){
        return empService.updStatus(dto);
    }
    @RequestMapping("findAll")
    public Result findAll() throws IOException {
        return empService.findAll();
    }
    @RequestMapping("findSer")
    public List<EmpSer> findSer(){
        return empService.findSer();
    }
    @RequestMapping("delSer")
    public String delSer(String id){
        return empService.delSer(id);
    }
}
